<template>
	<view>
		<uni-list>
			<!-- 右侧带角标 -->

			<!-- 头像显示角标 -->
			<uni-list-chat v-for="(item,index) in menuList" :key="index" :avatar-circle="true" :title="item.type"
				:avatar="item.img" :note="item.content" :time="item.time" badge-positon="left" badge-text="dot"
				:to="item.to"></uni-list-chat>


		</uni-list>
	</view>
</template>

<script>
	import {
		toast,
		useRouter,
		signOut,
		getStorageSync
	} from '../../utils/utils.js'
	export default {
		data() {
			return {
				menuList: [{
						type: '公告',
						to: '/pages/message/detail',
						img: '../../static/icons/tongzhi.png',
						time: '2020-0302 20:23',
						content: '您收到一条信息'
					},
					{
						type: '公告',
						to: '/pages/message/detail',
						img: '../../static/icons/tongzhi.png',
						time: '2020-0302 20:23',
						content: '您收到一条信息'
					},
					{
						type: '公告',
						to: '/pages/message/detail',
						img: '../../static/icons/tongzhi.png',
						time: '2020-0302 20:23',
						content: '您收到一条信息'
					},
					{
						type: '公告',
						to: '/pages/message/detail',
						img: '../../static/icons/tongzhi.png',
						time: '2020-0302 20:23',
						content: '您收到一条信息'
					},

				]
			};
		},
		onShow() {
			uni.setTabBarBadge({
				index: 1,
				text: '100'
			})
		},
		onTabItemTap() {
			const token = getStorageSync('token') || null

			if (!token) {

				signOut()
				toast('请先登录后在使用!')
			}
		},
		methods: {

		}
	}
</script>

<style lang="scss">

</style>